/*
 * @Author: your name
 * @Date: 2020-01-04 22:19:08
 * @LastEditTime : 2020-01-06 02:03:31
 * @LastEditors  : Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /nest-app/src/photo/photo.entity.ts
 */
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';
@Entity('photo')
export default class PhotoEntity {
  @ApiProperty({ name: 'uid' })
  @PrimaryGeneratedColumn('increment', { type: 'bigint' })
  id: number;

  @ApiProperty()
  @Column({ length: 100, comment: '姓名' })
  name: string;

  @ApiProperty({ description: '描述' })
  @Column({ comment: '描述' })
  description: string;

  @ApiProperty()
  @Column({ comment: '文件内容' })
  filename: string;

  @ApiProperty()
  @Column('int', { comment: '观看人数' })
  views: number;

  @ApiProperty()
  @Column('boolean', { comment: '是否共享', default: false })
  isPublished: boolean;
}
